package com.wzh.houseEs.web;

import com.wzh.common.utils.R;
import com.wzh.houseEs.service.EsService;
import com.wzh.houseEs.vo.EsVo;
import com.wzh.houseEs.vo.SearchParam;
import com.wzh.houseEs.vo.SearchResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author WZH
 * @title: WebController
 * @projectName find_house
 * @description:
 * @date 2022/3/25
 */
@Controller
public class WebController {

    @Autowired
    private EsService esService;

    /**
     * 新房查询
     * @param searchParam
     * @return
     */
    @RequestMapping("newHouseList")
    public String newHouseList(SearchParam searchParam, Model model){
        SearchResultVo resultVo = esService.newHouseList(searchParam);
        model.addAttribute("resultVo",resultVo);
        model.addAttribute("flag",searchParam.getFlag());
        return "search";
    }
}
